Internal sort process

ABSTRACT

A NOVEL INTERNAL SORT PROCESS IS PRESENTED WHEREBY, IF THE PRIMARY STORAGE AREA MADE AVAILABLE FOR THE SORT HAS THE VALUE LL, THERE CAN BE UTILIZED A SECONDARY STORAGE AREA HVING THE VALUE RXLL IN CARRYING OUT THE SORT. GIVEN AN INPUT SEQUENCE OF RECORDS TO BE SORTED, THE TERM LL DENOTES THE NUMBER OF RECORDS WHICH CAN BE ACCOMMODATED IN THE AVAILABLE PRIMARY STORAGE AREA AND THE TERM R IS A MULTIPLIER OF LL WHICH CAN BE SELECTED BY THE USER. IN THE PROCESS THE SECONDARY STORAGE AREA OF CAPACITY RXLL RECORDS IS EMPLOYED TO FORM A REJECT LIST. THE REJECT LIST RECEIVES, IN ORDER, THOSE ITEMS IN THE INPUT SEQUENCE THAT ARE SMALLER THAN THE ITEMS CURRENTLY IN PRIMARY STORAGE UP TO ITS CAPACITY OF RXLL. THEN, WHEN   THE CURRENT OUTPUT STRING CAN NO LONGER BE EXTENDED, THE ITEMS IN THE REJECT LIST ARE FIRST PROCESSED AT THE INCEPTION OF THE FORMATION OF THE NEXT OUTPUT STRING BEFORE THE NEXT ITEMS IN THE INPUT SEQUENCE ARE CONSIDERED. THIS LATTER STAGE OF THE PROCESS WILL RESULT IN RE-EJECTED ITEMS, BUT THEY EVENTUALLY WILL FIND THEIR WAY TO AN OUTPUT STRING. ACCORDINGLY, WITH THIS PROCESS, THERE IS ENABLED THE PRODUCTION OF STRINGS WHOSE LENGTHS CAN BE THEREBY THE PROTHE DEGREE OF INCREASE BEING DEPENDENT UPON THE SELECTION OF THE VALUE OF THE TERM R.

Eh NSEVE PULIQATiN UNITED STATES PATENT AND TRADEMARK orrron Published at the request of the applicant or owner in accordance with the Notice of Dec. 16, 1969, 869 0.G 687. The abstracts of Defensive Publication applications are identified by distinctly numbered series and are arranged chronologically. The heading of each abstract indicates the number of pages of specification, including claims and sheets of drawings contained in the application as originally filed. The files of these applications are available to the public for inspection and reproduction. may be purchased for 30 cents a sheet.

Defensive Publication applications have not been era Trademark Office makes no assertion as to the novelty of the ed as to the merits of altered invention. The Patent and .sclosed snide-2t matter.

PUBLISHED SEPTEMBER 2, 1975 $938,007 INTERNAL sonT rnocnss tflnttttt iltititihlllt William D. Frazer, Briarclitt Manor, and (Chair-Koch Wong, ?eekskill, N.Y., assignors to International BuJ- w ness Machines Corporation, Armonk, NY. Continuation of application Scr. No. 103:,tl85, Ber. 31,

197417. This application Jan. 18, 1974, Set. No. 434,525

int. Cl. Gildf 7/22, 7/36 U5. (ll. 444-1 4 Sheets Drawing. 19 Pages pecification A novel internal sort process is presented whereby, if the primary storage area made available for the sort has the value LL, there can be utilized a secondary storage area having the value RXLL in carrying out the sort.

TIIE INPUT SEQUENCE WITH THE SMALLEST ITERI IN THE PRIMARY STORAGE AREA.

1! a APPEID SNALLEST Glven an input sequence 01 records to by sorted, the HEMINPMW musmmmm term LL denotes the number of records which can be g lggst lg fglf 'f m accommodated in the available primary storage area and PLACE u minim ax:222? the term R 18 a multiplier of LL which can be selected by the user. In the process the secondary storage area of capacity RXLL records is employed to form a reject list. The reject list receives, in order, those items in the input sequence that are smaller than the items currently in primary storage up to its capacity of RXLL. Then, when the current output string can no longer be extended, the items in the reject list are first processed at the inception of the formation of the next output string before the next items in the input sequence are considered. This latter stage of the process will result in re-rejectcd items, but they eventually Will find their way to an output string. Accordingly, with this process, there is enabled the production of strings whose lengths can be thereby increased, the degree of increase being dependent upon the sclection of the value of the term R.

mam THE LL ITEMS cumzruu IN PRIMARY sums T0 in: CURRENT smut sumo m DRIIER. STRING Is now comm, sum not sums.

nrnu PRIMARY some: in rrmcmc rm 0F TIIE ABOVE ms mm ONEDF THE TIIP IEARLIESI' REJECTED) urns III THE CURRENT REJECT LIST. nouns TEE momma urns (Ii-mu.) IN THEREJECT usr AT nus POINT A5 'umocrssrn:

YES EESSED ITENS RE" NAINING 1N TNE REJECT IINPIIOCESSED IJNPRQCESSED REJECT ITEM REJEIIT ITEN SMALLER LARGER PLACE IHIRNERLYl UNPRR- CESSED REJEBT AT FRONT END OF REJEET LIST IN FIRST NPEN POSITION. AT THIS POINT. IT CEASES TO BE UNPRRGESSED.

AFPEHD SNALLEST ITEN IN PRIMARY STORAGE T0 CURRENT OUTPUT STRING; REPLACE IT BY UNPNOCESSEI] REJEOT.

w. D. FRAZER ETTA!- T933907 INTERNAL SORT PROCESS Sept. 2, 1975 Original Filed Dec. 31, 1970 4 Sheets-Sheet 1 FIG.1

FIG. 1A

FIG.

IA LOAD PRIMARY STORAGE AREA wITH LL ITEMs FROM THE IHPuT sEouEMc Fl 6. I

I2 coMPARE NEXT TTEM FROM THE IMPuT SEQUENCE wITH THE SMALLEST ITEM IH THE PRIMARY STORAGE IMPuT INPUT ITEM ITEM LARGER SMALLER I I APPEND sMA LEsT I ITEM IN PRIMARY TRAMsEER INPUT ITEM STORAGE To cuRREMT T0 TAIL 0F "REJECT" OUTPUT STRING; LIsT IM SECONDARY PLAcE IT IN PRIMARY STORAGE AREA STORAGE BY INPUT ITEM.

RxLL 0R MoRE 1:: ITEM IN REJECT LNVENTORS 18 wILLIAM D. FRAZER CHAK- KUEN WONG BYJ/Q L hark ATTORNEY Sept. 2, 1975 w. p. FRAZER ETAL T938,007

INTERNAL SORT PROCESS Original Filed Dec. 31,, 1970 4 Sheets-Sheet 8 FIG.IB A) APPEND THE LL ITEMS CURRENTLY IN PRIMARY STORAGE TO THE CURRENT OUTPUT STRING IN ORDER. STRING IS NOW COMPLETE. START NEW STRING.

REFILL PRIMARY STORAGE BY REPLACING EACH OF THE ABOVE ITEMS WITH ONE OF THE TOP (EARLIEST REJECTED) ITEMS IN THE CURRENT REJEGT LIST.

DENOTE THE REMAINING ITEMS (R-IIILL) IN THE REJECT LIST AT THIS POINT AS "UNPROCESSED':

ANY UNPRO- CESSED ITEMS RE- MAINING IN THE REJECT LIST? NEXT UNPROCESSED UNPROCESSED UNPROCESSEI) REJECT ITEM ITEM FROM REJECT LIST WITH REJECT ITEM SMALLER SMALLEST ITEM IN PRIMARY LARGER STORAGE AREA.

28 PLACE IFORMERLY) UNPRO- CESSED REJECT AT FRONT APPEND SMALLEST ITEM IN END OF REJECT LIST IN PRIMARY STORAGE TO CURRENT FIRST OPEN POSITION. AT OUTPUT STRING; REPLACE IT THIS POINT, IT CEASES TO BY UNPROCESSED REJECT.

BE UNPROCESSED.

Sept. 2, 1975 w, FRAZER EI'AL T938,007

INTERNAL SORT PROCESS Original Filed Dec. 31, 1970 4 Sheets-Sheet 3 FIG. 2A FIG LOAD PRIMARY STORAGE AREA WITH FIG. 2 LL ITEMS FROM THE INPUT SEQUENCE 28 START NEW OUTPUT STRING. \34

IN PRIMARY STORACE,SELECT ITEM WITH SMALLEST KEY, Xs AND APPEND 36 IT TO CURRENT OUT-PUT STRING.

REPLACE ITEM JUST SELECTED WITH NEXT ITEM FROM INPUT SEQUENCE 38 LET Xr BE ITS KEY.

YES

APPEND THE CURRENT REPLACEMENT -42 ITEM TO THE REJECT LIST.

Sept. 2, 1975 W. D. FRAZER ETAL INTERNAL SORT PROCESS Original Filed Dec. 31, 1970 4 Sheets-Sheet 4 RENAME CURRENT REJECT LIST AS "OLD REJECT LIST".CALL LL REMAINING ITEMS IN PRIMARY STORAGE AREA "ELIGIBLE';

ALL OTHER ITEMS "INELIGIBLE".

APPEND i SMALLEST ELIGIBLE ITEM T0 CURRENT OUTPUT STRING REPLACE BY INELIGIBLE i START NEW OUTPUT STRING.

IS OLD REJECT LIST EMPTY YES IN PRIMARY STORAGE,SELECT ITEM WITH SMALLEST KEY, Xs AND APPEND IT TO CURRENT OUTPUT STRING.

REPLACE ITEM JUST SELECTED WITH NEXT ITEM FROM THE OLD REJECT LIST. LET X BE ITS KEY.

ITEM FROM OLD REJECT LIST.

REPLACE ITEM JUST REJECTED WITH NEXT ITEM FROM OLD RE- JEGT LIST. LET X BE ITS KEY.

FIG.

APPEND REPLACEMENT ITEM TO REJECT LIST. (THIS LIST IS TO BE DISTINGUISHED FROM THE OLD REJECT LIST.

IS OLD REJECT LIST EMPTY 

